import { request } from "@/utils/request";
import { dayjs } from 'element-plus'

// 当天起始时间和结束时间
const StartDate = dayjs().format('YYYY-MM-DD 00:00:00');
const EndDate = dayjs().format('YYYY-MM-DD 23:59:59');


export const GreenNetTkIncome = (params?: Record<string, any>) => {
    return request({
        url: "/st/bigscreen/GreenNetTkIncome",
        method: "get",
        params: {
            StartDate,
            EndDate,
           ...params,
        },
    });
};

export const GreenStationIncome = (params?: Record<string, any>) => {
    return request({
        url: "/st/bigscreen/GreenStationIncome",
        method: "get",
        params: {
            StartDate,
            EndDate,
        ...params,
        },
    });
};

export const GreenSellOperIncome = (params?: Record<string, any>) => {
    return request({
        url: "/st/bigscreen/GreenSellOperIncome",
        method: "get",
        params: {
            StartDate,
            EndDate,
            ...params,
        },
    });
};

// 近七日
export const GreenSellTk = (params?: Record<string, any>) => {
    return request({
        url: "/st/bigscreen/GreenSellTk",
        method: "get",
        params: {
            StartDate: dayjs().subtract(7, 'days').format('YYYY-MM-DD 00:00:00'),
            EndDate: dayjs().format('YYYY-MM-DD 23:59:59'),
          ...params,
        },
    });
};

export const GreenPopularStop = (params?: Record<string, any>) => {
    return request({
        url: "/st/bigscreen/GreenPopularStop",
        method: "get",
        params: {
            StartDate,
            EndDate,
           ...params,
        },
    });
};

export const GreenSalesOrderTk = (params?: Record<string, any>) => {
    return request({
        url: "/st/bigscreen/GreenSalesOrderTk",
        method: "get",
        params: {
            StartDate: dayjs().format('YYYY-MM-DD'),
            EndDate: dayjs().format('YYYY-MM-DD'),
           ...params,
        },
    });
};

